package com.db;

import com.mysql.jdbc.Driver;

import java.sql.Connection;
import java.sql.DriverManager;

public class BaseDao {
    static  Connection con = null;

    public static Connection getCon(){
        try {
            //1 加载驱动
            Class.forName("com.mysql.jdbc.Driver");
            // 2 获取连接
             con =  DriverManager.getConnection("jdbc:mysql://123.56.76.249:3309/test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true","root","1Q2W3E4R");
        } catch (Exception e) {
            e.printStackTrace();
        }
        return con;
    }


}
